// import  './assets/css/main.css'
import {createApp} from 'vue'
import {createPinia} from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import VueCropper from 'vue-cropper'
import 'vue-cropper/dist/index.css'
//导入element-plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//pinia持久化插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import './assets/iconfont/iconfont.css'
//引入重置路由的方法 
import {flushMenu} from './hooks/routeTrick'

 
const app = createApp(App)
//注册图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(VueCropper)
app.use(ElementPlus, {locale: zhCn})
app.use(pinia)

await flushMenu()
app.use(router)

app.mount('#app')
